<template>
    <div class="mui-numbox box3" data-numbox-min='1' data-numbox-max='9'>
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input ref='numbox' class="mui-input-numbox" type="number" :value="initcount" @change='numChange'/>
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>
<script>
    import mui from '../../lib/mui/js/mui.min.js'
    export default {
        mounted() {
            mui('.box3').numbox()
        },
        props: ['initcount','id'],
        data(){
            return {

            }
        },
        methods:{
            numChange(){
                var num= parseInt(this.$refs.numbox.value);
                var goods={id:this.id,count:num};
                this.$store.commit('resetCarCount',goods)
            }
        }
    }
</script>
<style lang="scss" scoped>
    .mui-numbox {
        height: 25px;
    }
</style>
